<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="tKpJiageList" checkbox="true" sortName="sortmy" pagination="true" fitColumns="false" title="价格审核" actionUrl="tKpJiageController.do?datagrid" idField="id" fit="true" queryMode="group">

   <t:dgCol title="操作" field="opt" width="80"></t:dgCol>
   <%--<t:dgCol title="客户编码"  field="cusCode"  query="true"  queryMode="single"  dictionary="pop_kp_cus,cusCode,cusName,cus_code,cus_name"  popup="true"  width="120"></t:dgCol>--%>
   <t:dgCol title="客户名称"  field="cusName"  query="true" dictionary="t_kp_cus,cus_name,cus_name"  queryMode="single"  width="60"></t:dgCol>
   <%--<t:dgCol title="工地编码"  field="gdCode"  query="true"  queryMode="single"  dictionary="pop_kp_gongdi,gdCode,gdName,gd_code,gd_name"  popup="true"  width="120"></t:dgCol>--%>
   <t:dgCol title="承建单位"  field="gdName"  query="true"  queryMode="single"  width="240"></t:dgCol>
   <%--<t:dgCol title="产品编码"  field="cpCode"  query="true"  queryMode="single"  dictionary="pop_kp_chanpin,cpCode,cpName,cp_code,cp_name"  popup="true"  width="120"></t:dgCol>--%>
   <t:dgCol title="产品名称"  field="cpName"  query="true"  queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="规格"     field="by2"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="等级"   hidden="true" field="by3"  queryMode="single"  width="70"></t:dgCol>
   <t:dgCol title="单位"   hidden="true" field="by4"  queryMode="single"  width="70"></t:dgCol>
   <t:dgCol title="开票价格"  field="cpJiage"  queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="待审批价格"  field="cpDshenjia"  queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="出厂价"  field="chuchangfei"  queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="运输费"  field="yunshufei"  queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="备注"  field="jgRemark"  queryMode="single"  width="60"></t:dgCol>
   <%--<t:dgCol title="申请备注"  field="sqRemark"  queryMode="single"  width="120"></t:dgCol>--%>
   <%--<t:dgCol title="审批备注"  field="spRemark"  queryMode="single"  width="120"></t:dgCol>--%>
   <%--<t:dgCol title="备用1" hidden="true" field="by1"  queryMode="single"  width="120"></t:dgCol>--%>
   <%--<t:dgCol title="备用2"   hidden="true" field="by2"  queryMode="single"  width="120"></t:dgCol>--%>
   <%--<t:dgCol title="备用3"   hidden="true" field="by3"  queryMode="single"  width="120"></t:dgCol>--%>
   <%--<t:dgCol title="备用4"   hidden="true" field="by4"  queryMode="single"  width="120"></t:dgCol>--%>
   <t:dgCol title="备用5"  hidden="true"  field="by5"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="排序"  field="sortmy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>

   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人"  field="createBy"   hidden="true"   queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate"  hidden="true"   formatter="yyyy-MM-dd"    queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="更新人名称"  field="updateName"     queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新日期"  field="updateDate"  formatter="yyyy-MM-dd"     queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="所属部门"  field="sysOrgCode"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="所属公司"  field="sysCompanyCode"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="流程状态"  field="bpmStatus"    hidden="true"  queryMode="single"  dictionary="bpm_status"  width="60"></t:dgCol>
   <%--<t:dgDelOpt title="审批" url="tKpJiageController.do?doDel&id={id}" urlclass="ace_button"  urlfont="fa-trash-o"/>--%>
     <t:dgConfOpt  url="tKpJiageController.do?doUpdatesh&id={id}"  title="审核" urlclass="ace_button"   exp="bpmStatus#eq#2" message="确定审核通过？"/>

   <%--<t:dgToolBar title="新建价格" icon="icon-add" url="tKpJiageController.do?goAdd" funname="add"></t:dgToolBar>--%>
   <%--<t:dgToolBar title="填写备注" icon="icon-edit" url="tKpJiageController.do?goUpdate" funname="update"></t:dgToolBar>--%>
   <t:dgToolBar title="批量审核"  icon="icon-remove"   funname="pldeleteALLSelect"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="tKpJiageController.do?goUpdate" funname="detail"></t:dgToolBar>
   <%--<t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>--%>
   <t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
   <%--<t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar>--%>
  </t:datagrid>
  </div>
 </div>
 <script src = "webpage/com/yserp/kpmd/tKpJiageList.js"></script>		
 <script type="text/javascript">
 $(document).ready(function(){
 });

 function pldeleteALLSelect() {
     var gname = "tKpJiageList";
     var gridname=gname;
     var ids = [];
     var rows = $("#"+gname).datagrid('getSelections');
     if (rows.length > 0) {
         $.dialog.setting.zIndex = getzIndex(true);
         $.dialog.confirm('你确定批量审核该数据吗?', function(r) {
             if (r) {
                 for ( var i = 0; i < rows.length; i++) {
                     if(rows[i].bpmStatus==2){
                         ids.push(rows[i].id);
                     }
                 }
                 $.ajax({
                     url : "tKpJiageController.do?doUpdateshbat",
                     type : 'post',
                     data : {
                         ids : ids.join(',')
                     },
                     cache : false,
                     success : function(data) {
                         var d = $.parseJSON(data);
                         if (d.success) {
                             var msg = d.msg;
                             tip(msg);
                             reloadTable();
                             $("#"+gname).datagrid('unselectAll');
                             ids='';
                         }
                     }
                 });
             }
         });
     } else {
         tip("请选择需要审核的数据");
     }
 }
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'tKpJiageController.do?upload', "tKpJiageList");
}

//导出
function ExportXls() {
	JeecgExcelExport("tKpJiageController.do?exportXls","tKpJiageList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("tKpJiageController.do?exportXlsByT","tKpJiageList");
}

 </script>